/*
* Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved.
*/

#define SET_VPC_PIC_FMT(fmt, rank_) \
do { \
    fmt_info->vpc_pic_fmt = (fmt); \
    fmt_info->rank = (rank_); \
} while (0)

#define SET_PIXEL_FMT(p0fmt, p1fmt, p2fmt) \
do { \
    fmt_info->port_fmt.p0 = (p0fmt); \
    fmt_info->port_fmt.p1 = (p1fmt); \
    fmt_info->port_fmt.p2 = (p2fmt); \
} while (0)

#define SET_PIXEL_STEP(xstep, ystep) \
do { \
    fmt_info->pixel_step.x = (xstep); \
    fmt_info->pixel_step.y = (ystep); \
} while (0)

#define SET_DOWN_SAMPLE_COEFF(val0, val1, val2, val3, val4, val5) \
do { \
    fmt_info->down_sample_coeff.val[0] = (val0); \
    fmt_info->down_sample_coeff.val[1] = (val1); \
    fmt_info->down_sample_coeff.val[2] = (val2); \
    fmt_info->down_sample_coeff.val[3] = (val3); \
    fmt_info->down_sample_coeff.val[4] = (val4); \
    fmt_info->down_sample_coeff.val[5] = (val5); \
} while (0)

#define SET_UVUP_EN(en) \
do { \
    fmt_info->uvup_en = (en); \
} while (0)

#define SET_PORT_DU(du0, du1, du2) \
do { \
    fmt_info->port_du.p0 = (du0); \
    fmt_info->port_du.p1 = (du1); \
    fmt_info->port_du.p2 = (du2); \
} while (0)

#define SET_SWAP_CFG(enable, incfg, outcfg) \
do { \
    fmt_info->swap.en = (enable); \
    fmt_info->swap.inPos = (incfg); \
    fmt_info->swap.outPos = (outcfg); \
} while (0)

#define SET_PLANN_FMT(fmt) \
do { \
    fmt_info->plannar_fmt = (fmt); \
} while (0)

#define CHECK_SUCC_RET(condition) \
do { \
    if ((condition) == 0) { \
        return 0; \
    } \
} while (0)
